package sjtu.rfid.rri.services.device;


/**
 * The enum type about the status of reading
 * 
 * @author jinghao
 * 
 */
public enum ReadingStatus {
	UNSTARTED, ACTIVE, PAUSED, CLOSED;

	/**
	 * a convenient static factory to build the BizLocationType from String
	 * name.
	 * 
	 * @param type
	 * @return
	 */
	public static ReadingStatus buildFromString(String type) {
		if (UNSTARTED.toString().equals(type)) {
			return UNSTARTED;
		} else if (ACTIVE.toString().equals(type)) {
			return ACTIVE;
		} else if (PAUSED.toString().equals(type)) {
			return PAUSED;
		} else if (CLOSED.toString().equals(type)) {
			return CLOSED;
		} else {
			return null;
		}
	}

}
